<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
<html>
<head>
	<title>solution detail</title>
	<meta name="decorator" content="default"/>
	<style type="text/css">
		th {text-align: center !important;}
		td {text-align: center !important;}
	</style>
</head>
<body>
	<tags:breadcrumb name="breadcrumb" />
	<div class="icon-buttons">
		<a id="return" data-role="button" data-icon="back" data-iconpos="notext" data-inline="true" href="#">返回</a>
	</div>
    <div data-role="collapsible" data-collapsed="false">
        <h5>采纳的产品</h5>
        <div class="middleCls">
			<c:if test="${empty detail.productList}">
				<h4>无记录</h4>
			</c:if>
			<c:if test="${not empty detail.productList}">
				<table data-role="table" class="ui-responsive table-stroke">
					<thead>
						<tr>
							<th>产品渠道</th>
							<th>产品类别</th>
							<th>产品名称</th>
							<th>规格</th>
							<th>价格</th>
						</tr>
					</thead>
					<tbody>
						<c:forEach items="${detail.productList}" var="product">
							<tr>
								<td>
									${fns:getDictLabel(product.storeProduct.product_type, "product_type", "")}
								</td>
								<c:if test="${product.storeProduct.product_type == 0}">
									<td>${product.storeProduct.product.productCategory.name}</td>
									<td>${product.storeProduct.product.name}</td>
									<td>${product.storeProduct.product.spec}</td>
									<td>${product.storeProduct.product.retail_price}</td>
								</c:if>
								<c:if test="${product.storeProduct.product_type == 1}">
									<td>${product.storeProduct.storeSelfProduct.storeSelfProductCategory.name}</td>
									<td>${product.storeProduct.storeSelfProduct.name}</td>
									<td>${product.storeProduct.storeSelfProduct.spec}</td>
									<td>${product.storeProduct.storeSelfProduct.retail_price}</td>
								</c:if>
							</tr>
						</c:forEach>
					</tbody>
				</table>
			</c:if>
		</div>
    </div>
    <div data-role="collapsible" data-collapsed="false">
        <h5>采纳的护理</h5>
        <div class="middleCls">
			<c:if test="${empty detail.careList}">
				<h4>无记录</h4>
			</c:if>
			<c:if test="${not empty detail.careList}">
				<table data-role="table" class="ui-responsive table-stroke">
					<thead>
						<tr>
							<th>渠道</th>
							<th>护理名称</th>
							<th>护理时长</th>
							<th>价格</th>
						</tr>
					</thead>
					<tbody>
						<c:forEach items="${detail.careList}" var="care">
							<tr>
								<td>
									${fns:getDictLabel(care.storeCare.care_type, "product_type", "")}
								</td>
								<c:if test="${care.storeCare.care_type == 0}">
									<td>${care.storeCare.care.name}</td>
									<td>${care.storeCare.care.duration}</td>
									<td>${care.storeCare.care.price}</td>
								</c:if>
								<c:if test="${care.storeCare.care_type == 1}">
									<td>${care.storeCare.storeSelfCare.name}</td>
									<td>${care.storeCare.storeSelfCare.duration}</td>
									<td>${care.storeCare.storeSelfCare.price}</td>
								</c:if>
							</tr>
						</c:forEach>
					</tbody>
				</table>
			</c:if>
		</div>
    </div>
 	<script type="text/javascript">
		$(document).ready(function() {
			loadingDisplayTable("contentTableProduct");
			loadingDisplayTable("contentTableCare");
			addParentPageNo();
		});
		function addParentPageNo() {
			var reportStart = sessionStorage.reportStartSecond;
			var reportEnd = sessionStorage.reportEndSecond;
			var	returnHref = "${ctx}/report/all/solution?startDate=" +reportStart + "&endDate=" + reportEnd;
			$("#return").attr("href", returnHref);
		}
	</script>
</body>
</html>
